package com.dz.lm.dao.product.write;

import com.dz.lm.common.exception.DaoException;
import com.dz.lm.common.utils.stereotype.WriterRepository;
import com.dz.lm.domain.product.Product;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@WriterRepository("writeProductDao")
public interface ProductDao {
    int deleteByPrimaryKey(Integer productId);

    int insert(Map<String, Object> param);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer productId);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    List<Product> listProduct(@Param("status") Byte status,
                              @Param("offset") Integer offset,
                              @Param("pageSize") Integer pageSize);
    
    int applyProductAgent(Map<String, Object> param) throws DaoException;
    int add2levelAgentProductList(List<Map<String, Object>>param) throws DaoException;
    int updateAgentProduct(Map<String, Object> param) throws DaoException;
    int auditAgentProduct(Map<String, Object> param) throws DaoException;
    int audit2LevelAgentProduct(Map<String, Object> param) throws DaoException;
    int delAgentProduct(Map<String, Object> param) throws DaoException;
    int del2LevelAgentProduct(Map<String, Object> param) throws DaoException;
    int refreshUpdateTimeProduct() throws DaoException;
    int refreshUpdateTimeAgentProduct() throws DaoException;
    /**
     * 删除当前用户创建的产品数据
     */
    Integer delMyProduct(Map<String, Object> qryParam) throws DaoException;
    
    int modifyProduct(Map<String, Object> qryParam) throws DaoException;
}